module detection_engine #(
  parameter THRESH = 32'h3F800000 // FP32格式的1.0
)(
  input  wire [31:0]  data_in,
  output wire         is_attack
);

  // 特征1：梯度符号密度检测
  wire [7:0] sign_changes;
  gradient_analyzer u_analyzer (
    .data(data_in),
    .changes(sign_changes)
  );

  // 特征2：频域异常检测  
  wire [31:0] freq_power;
  fft_wrapper u_fft (
    .time_domain(data_in),
    .freq_power(freq_power)
  );

  // 决策树逻辑
  assign is_attack = (sign_changes > 8'h40) && 
                    (freq_power > THRESH * 2);

endmodule